//
//  TimeUtil.swift
//  HFUTER
//
//  Created by HD on 15/1/21.
//  Copyright (c) 2015年 HD. All rights reserved.
//

import UIKit

class TimeUtil {
    
    //返回单个字的表示星期的字符
    class func wordWeek(week: Int) -> String {
        switch week {
        case 1:
            return "一"
        case 2:
            return "二"
        case 3:
            return "三"
        case 4:
            return "四"
        case 5:
            return "五"
        case 6:
            return "六"
        case 7:
            return "日"
        default:
            return ""
        }
    }
    
    class func sleep(time: Int, callback: () -> Void) {
        var sleepTime: NSTimeInterval = Double(time) / 1000
        ThreadUtil.childThread { () -> Void in
            NSThread.sleepForTimeInterval(sleepTime)//休眠1ms
            ThreadUtil.mainThread({ () -> Void in
                callback()
            })
        }
    }
}